home *** CD-ROM | disk | FTP | other *** search
/ MacHome 2001 January / MacHome Magazine Demo Disc January 2001.iso / mac / Software / Networking / InterMapper 3.0 - PPC.sea / InterMapper 3.0 - PPC / InterMapper™ 3.0-PPC / InterMapper™ 3.0-PPC.rsrc / PrTy_153_com.dartware.tcp.http < prev    next >
Encoding:
Text File  |  2000-07-24  |  3.8 KB  |  113 lines

  1. <!-- 
  2.     HTTP (com.dartware.tcp.http)
  3.     Copyright © 2000 Dartware, LLC. All rights reserved.
  4. -->
  5.  
  6. <header>
  7.     type            =     "tcp-script"
  8.     package            =     "com.dartware"
  9.     probe_name        =    "tcp.http"
  10.     human_name        =    "HTTP"
  11.     version            =     "1.1"
  12.     address_type    =     "IP"
  13.     port_number        =    "80"
  14.     
  15.     old_protocol    =     "8"            # Backward compat. with old numbering scheme.
  16.     old_script        =     "8000"
  17.  
  18. </header>
  19.  
  20. <description>
  21.  
  22. ≤GB≥Hypertext Transfer Protocol (HTTP)≤P≥
  23.  
  24. The protocol used to transfer web pages on the World Wide Web, defined in ≤U2≥RFC 2068≤P0≥ and ≤U2≥RFC 1945≤P0≥. The default TCP port number for HTTP connections is port 80.
  25.  
  26. This TCP probe lets you download a specific web page and scan it for a specific string of HTML.
  27.  
  28. ≤i≥Host Name≤p≥ is the domain name of the web server (e.g. “www.dartware.com”). This can be derived from the host name part of the URL that you want to test. You must enter a valid "Host Name" to test web servers which implement virtual hosts.
  29.  
  30. ≤i≥URL Path≤p≥ is the full path of the desired file on the web server (e.g. “/index.html”). The first character must be a '/'.
  31.  
  32. ≤i≥String to verify≤p≥ is a string to verify in the data returned by the HTTP server.  For example, if you are retrieving a web page, you might search for “<HTML>” or “<P>” to verify that the data is HTML.
  33.  
  34. ≤i≥User ID≤p≥ is the user name typed into the web browser's password dialog. The default is to leave this blank. You should set this parameter if you want to test a web page that requires authentication.
  35.  
  36. ≤i≥Password≤p≥ is the password for the web browser's dialog. The default is to leave this blank. You should set this parameter if you want to test a web page that requires authentication.
  37.  
  38. </description>
  39.  
  40. <parameters>
  41.  
  42. "Host Name"            =        ""
  43. "URL Path"            =        "/"
  44. "String to verify"    =        "<HTML>"
  45. "User ID"            =        ""
  46. "Password"            =        ""
  47.  
  48. </parameters>
  49.  
  50. <script>
  51.  
  52. CONN #60 (connect timeout in secs)
  53. WAIT #30 @IDLE (idle timeout in secs)
  54. DISC @DISCONNECT (disconnect handler)
  55. SEND "GET ${URL Path} HTTP/1.0\r\n"
  56. CHCK "${Host Name}" else goto #+2
  57. SEND "Host: ${Host Name}\r\n"
  58. SEND "User-Agent: InterMapper/${_VERSION}\r\n"
  59. CHCK "${User ID}${Password}" else goto #+2
  60. SEND "Authorization: Basic ${_BASE64:${User ID}:${Password}}\r\n"
  61. SEND "\r\n"
  62. MTCH "HTTP/"i else goto @UNEXPECTED_GREETING
  63. MTCH "200" else goto @BAD_GET_RESPONSE
  64. LINE OFF
  65. DISC if disconnected goto @NO_MATCH   (added line in 2.1.1b1)
  66. EXPT "${String to verify}"i else goto @NO_MATCH
  67. DONE OKAY
  68.  
  69. @IDLE:
  70. DONE DOWN "[HTTP] No data for ${_IDLETIMEOUT} seconds.  Was expecting \"${_STRINGTOMATCH}\". [Line ${_IDLELINE}]"
  71.  
  72. @UNEXPECTED_GREETING:
  73. DONE DOWN "[HTTP] Unexpected greeting from port ${_REMOTEPORT}. (${_LINE:50})"
  74.  
  75. @NO_MATCH:
  76. DONE WARN "[HTTP] \"${String to verify}\" not found in returned HTTP data."
  77.  
  78. @BAD_GET_RESPONSE:
  79. MTCH "201" ELSE #+2
  80. DONE WARN "[HTTP] 201 Created (${URL Path})"
  81. MTCH "202" ELSE #+2
  82. DONE WARN "[HTTP] 202 Accepted (${URL Path})"
  83. MTCH "204" ELSE #+2
  84. DONE WARN "[HTTP] 204 No Content (${URL Path})"
  85. MTCH "301" ELSE #+2
  86. DONE WARN "[HTTP] 301 Moved Permanently (${URL Path})"
  87. MTCH "302" ELSE #+2
  88. DONE WARN "[HTTP] 302 Moved Temporarily (${URL Path})"
  89. MTCH "304" ELSE #+2
  90. DONE WARN "[HTTP] 304 Not Modified (${URL Path})"
  91. MTCH "400" ELSE #+2
  92. DONE WARN "[HTTP] 400 Bad Request (${URL Path})"
  93. MTCH "401" ELSE #+2
  94. DONE WARN "[HTTP] 401 Unauthorized (${URL Path})"
  95. MTCH "403" ELSE #+2
  96. DONE WARN "[HTTP] 403 Forbidden (${URL Path})"
  97. MTCH "404" ELSE #+2
  98. DONE WARN "[HTTP] 404 Not Found (${URL Path})"
  99. MTCH "500" ELSE #+2
  100. DONE ALRM "[HTTP] 500 Internal Server Error (${URL Path})"
  101. MTCH "501" ELSE #+2
  102. DONE ALRM "[HTTP] 501 Not Implemented (${URL Path})"
  103. MTCH "502" ELSE #+2
  104. DONE ALRM "[HTTP] 502 Bad Gateway (${URL Path})"
  105. MTCH "503" ELSE #+2
  106. DONE ALRM "[HTTP] 503 Service Unavailable (${URL Path})"
  107. DONE ALRM "[HTTP] Unknown Error Code ${_LINE:4} (${URL Path})"
  108.  
  109. @DISCONNECT:
  110. DONE DOWN "[HTTP] Disconnected from port ${_REMOTEPORT} after ${_SECSCONNECTED} seconds."
  111.  
  112. </script>
  113.